package com.waves.design.strategy;

/**
 * 电影票类
 * 环境类
 * 环境类是使用方法的角色，它在实现某个功能时可以采用多种策略
 *
 */
public class MovieTicket {
    private double price;
    private Discount discount;

    public void setPrice(double price) {
        this.price = price;
    }

    public void setDiscount(Discount discount) {
        this.discount = discount;
    }

    public double getPrice() {
        return discount.calculate(this.price);
    }
}
